const maximumWealth = function (accounts) {
  return accounts.map(customer => customer.reduce((prev, item) => prev + item, 0)).sort((a, b) => b - a)[0]
};

console.log(maximumWealth([[2, 8, 7], [7, 1, 3], [1, 9, 5]]));